package com.baike.feign.fallback;

import com.baike.data.Result;
import com.baike.em.ConstantEnum;
import com.baike.feign.OrderServiceFeign;
import org.springframework.stereotype.Component;

//feign调用失败会走此兜底方法
@Component
public class OrderServiceFeignBack implements OrderServiceFeign {
    @Override
    public Result findOrderByOutTradeNo(String OutTradeNo) {
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result findAdOrderByOutTradeNo(String OutTradeNo) {
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result findOrderBystudentId(Long studentId, Long lessonId) {
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result updateAdOrderByOutTradeNo(String outTradeNo, String tradeNo) {
        //兜底业务方法,编写降级逻辑,打印错误日志,方便以后查询
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result updateOrderByOutTradeNo(String outTradeNo, String TradeNo) {
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result TimeOutAdOrderByOutTradeNo(String outTradeNo) {
        return Result.build(ConstantEnum.FALL_BACK);
    }

    @Override
    public Result orderTimeOut(String outTradeNo) {
        return Result.build(ConstantEnum.FALL_BACK);
    }
}
